
	/***********************************************************************************************

		Qpath static private methods:

			nodes	__qp_exp		(nodes, step, filter*)
			nodes	__qp_findA	(nodes, step)
			nodes	__qp_findP	(nodes, step)
			nodes	__qp_findS1	(nodes, step)
			nodes	__qp_findS2	(nodes, step)
			nodes	__qp_findC	(nodes, step)
			nodes	__qp_findD	(nodes, step)

	***********************************************************************************************/

	//Static private
	//-------------------------------------------------------------------------------
	jsl.Node.__qp_exp = function(__nodes, __step, __filter) {
		var __out, __ix, __i, __a, __l/*!@*/,$node,$1,$2/*@*/

		//@sys: some browsers when compile a function remove unneccessary piece of code
		//			therefore the replacement token became $1\t\t=\s1 not only $1
		$1		= 1
		__out	= []
		__i		= 0

		//1-all
		//-------------------------------------------------------------------------------
		if(!__step.sel)
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				$node = __nodes[__a]

				if(!__filter)	__out[__i++] = $2
				else if($2)		__out[__i++] = $node
			}
		//2-ix > 0
		//-------------------------------------------------------------------------------
		else if(__step.ix > 0) {

			__ix = __step.ix

			if(!__filter) {
				$node = __nodes[__ix - 1]
				if($node)	__out[__i++] = $2
			}
			else
				for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

					$node = __nodes[__a]

					if($2 && !--__ix) {
						__out[__i++] = $node
						break
					}
				}
		}
		//3-ix < 0
		//-------------------------------------------------------------------------------
		else {

			__ix = -__step.ix

			if(!__filter) {
				$node = __nodes[__nodes.length - __ix]
				if($node) __out[__i++] = $2
			}
			else
				for(__a = __nodes.length - 1; __a >= 0; __a--) {

					$node = __nodes[__a]

					if($2 && !--__ix) {
						__out[__i++] = $node
						break
					}
				}
			}
		return __out
	}
	//-------------------------------------------------------------------------------
	jsl.Node.__qp_findA = function(__nodes, __step) {
		var __out, __map, __ns, __a, __l, __ix, __tmp, __i, __i2, __tn, __id, __b/*!@*/,$node,$1,$2/*@*/

		$1		= 1
		__out	= []
		__map = {}
		__i		= 0
		__ix	= __step.ix
		__b		= !__step.prefix
		__ns 	= __step.prefix ? __step.ns[__step.prefix] : null
		__id	= __step.tnode && !__step.ttype ? "__lname" : "__type"

		if(__step.tnode === "node")										__tn = null
		else if(__step.ttype)													__tn = __step.tnode
		else if(__step.tnode)													__tn = __step.lname
		else if(__step.ts["default"] != null)					__tn = __step.ts["default"]

		if(__ix < 0)
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				$node = __nodes[__a]
				__tmp	= []
				__i2	= 0

				while(($node = $node.__parent === null ? null : $node.parent()))
					if((__tn ? $node[__id] === __tn : true) && (__b || $node.ns() === __ns) && $2)
						__tmp[__i2++] = $node

					$node = __tmp[__tmp.length + __ix]
					if($node && !__map[$node.__id]) {
						__out[__i++] 			= $node
						__map[$node.__id] = true
					}
			}
		else
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				$node = __nodes[__a]

				while(($node = $node.__parent === null ? null : $node.parent()))
					if((__tn ? $node[__id] === __tn : true) && (__b || $node.ns() === __ns) && $2)
						if(__ix == null || !--__ix) {
							if(!__map[$node.__id]) {
								__out[__i++] 			= $node
								__map[$node.__id] = true
							}
							if(__ix === 0) break
						}
			}

		__out.reverse()
		return __out
	}
	//-------------------------------------------------------------------------------
	jsl.Node.__qp_findP = function(__nodes, __step) {
		var __out, __i, __map, __a, __l, __ns, __tn, __id, __b/*!@*/,$node,$1,$2/*@*/

		$1		= 1
		__out	= []
		__i		= 0

		if(!__step.sel || __step.ix === 1 || __step.ix === -1) {

			__map = {}
			__b		= !__step.prefix
			__ns	= __step.prefix ? __step.ns[__step.prefix] : null
			__id	= __step.tnode && !__step.ttype ? "__lname" : "__type"

			if(__step.tnode === "node")										__tn = null
			else if(__step.ttype)													__tn = __step.tnode
			else if(__step.tnode)													__tn = __step.lname
			else if(__step.ts["default"] != null)					__tn = __step.ts["default"]

			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				$node 	= __nodes[__a]
				$node 	= $node.__parent === null ? null : $node.parent()

				if($node && !__map[$node.__id] && (__b || $node.ns() === __ns) && (__tn ? $node[__id] === __tn : true) && $2) {
					__out[__i++] 			= $node
					__map[$node.__id] = true
				}
			}
		}
		return __out
	}
	//-------------------------------------------------------------------------------
	jsl.Node.__qp_findS1 = function(__nodes, __step) {
		var __out, __i, __i2, __map, __left, __ns, __a, __l, __p, __tmp, __ix, __sib, __b, __l2, __tn, __id, __dns, __c/*!@*/,$node,$1,$2/*@*/

		$1			= 1
		__out		= []
		__map 	= {}
		__i			= 0
		__left	= arguments[2]
		__ix		= __step.ix
		__c			= !__step.prefix
		__ns 		= __step.prefix ? __step.ns[__step.prefix] : null
		__id		= __step.tnode && !__step.ttype ? "__lname" : "__type"

		if(__step.tnode === "node")										__tn = null
		else if(__step.ttype)													__tn = __step.tnode
		else if(__step.tnode)													__tn = __step.lname
		else if(__step.ts["default"] != null)					__tn = __step.ts["default"]

		if(__ix < 0)
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				$node	= __nodes[__a]
				__p 	= $node.__parent === null ? null : $node.parent()
				__sib	= __p ? (__p.__childs || __p.__drv_children()) : null

				if(__sib) {

					__tmp	= []
					__i2	= 0
					__dns	= $node.defaultNs(true)

					for(__b = 0, __l2 = $node.childIndex(); __b < __l2; __b++) {

						$node = __sib[__b].__drv ? __sib[__b] : __p.__drv_child(__b)

						if((__tn ? $node[__id] === __tn : true) && (__c || __ns === ($node.__pfx ? $node.ns() : __dns)) && $2)
							__tmp[__i2++] = $node
					}

					$node = __tmp[__tmp.length + __ix]
					if($node && !__map[$node.__id]) {
						__out[__i++] 			= $node
						__map[$node.__id] = true
					}
				}
			}
		else
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				$node	= __nodes[__a]
				__p 	= $node.__parent === null ? null : $node.parent()
				__sib	= __p ? (__p.__childs || __p.__drv_children()) : null

				if(__sib) {

					__dns	= $node.defaultNs(true)

					for(__b = 0, __l2 = $node.childIndex(); __b < __l2; __b++) {

						$node = __sib[__b].__drv ? __sib[__b] : __p.__drv_child(__b)

						if((__tn ? $node[__id] === __tn : true) && (__c || __ns === ($node.__pfx ? $node.ns() : __dns)) && $2)
							if(__ix == null || !--__ix) {
								if(!__map[$node.__id]) {
									__out[__i++] 			= $node
									__map[$node.__id] = true
								}
								if(__ix === 0) break
							}
					}
				}
			}

		return __out
	}
	//-------------------------------------------------------------------------------
	jsl.Node.__qp_findS2 = function(__nodes, __step) {
		var __out, __i, __i2, __map, __left, __ns, __a, __l, __p, __tmp, __ix, __sib, __b, __l2, __tn, __id, __dns, __c/*!@*/,$node,$1,$2/*@*/

		$1			= 1
		__out		= []
		__map 	= {}
		__i			= 0
		__left	= arguments[2]
		__ix		= __step.ix
		__c			= !__step.prefix
		__ns 		= __step.prefix ? __step.ns[__step.prefix] : null
		__id	= __step.tnode && !__step.ttype ? "__lname" : "__type"

		if(__step.tnode === "node")										__tn = null
		else if(__step.ttype)													__tn = __step.tnode
		else if(__step.tnode)													__tn = __step.lname
		else if(__step.ts["default"] != null)					__tn = __step.ts["default"]

		if(__ix < 0)
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				$node = __nodes[__a]
				__p 	= $node.__parent === null ? null : $node.parent()
				__sib	= __p ? (__p.__childs || __p.__drv_children()) : null

				if(__sib) {

					__tmp	= []
					__i2	= 0
					__dns	= $node.defaultNs(true)

					for(__b = $node.childIndex() + 1, __l2 = __sib.length; __b < __l2; __b++) {

						$node = __sib[__b].__drv ? __sib[__b] : __p.__drv_child(__b)

						if((__tn ? $node[__id] === __tn : true) && (__c || __ns === ($node.__pfx ? $node.ns() : __dns)) && $2)
							__tmp[__i2++] = $node
					}

					$node = __tmp[__tmp.length + __ix]
					if($node && !__map[$node.__id]) {
						__out[__i++] 			= $node
						__map[$node.__id] = true
					}
				}
			}
		else
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				$node = __nodes[__a]
				__p 	= $node.__parent === null ? null : $node.parent()
				__sib	= __p ? (__p.__childs || __p.__drv_children()) : null

				if(__sib) {

					__dns	= $node.defaultNs(true)

					for(__b = $node.childIndex() + 1, __l2 = __sib.length; __b < __l2; __b++) {

						$node = __sib[__b].__drv ? __sib[__b] : __p.__drv_child(__b)

						if((__tn ? $node[__id] === __tn : true) && (__c || __ns === ($node.__pfx ? $node.ns() : __dns)) && $2)
							if(__ix == null || !--__ix) {
								if(!__map[$node.__id]) {
									__out[__i++]			= $node
									__map[$node.__id] = true
								}
								if(__ix === 0) break
							}
					}
				}
			}

		return __out
	}
	//-------------------------------------------------------------------------------
	jsl.Node.__qp_findC = function(__nodes, __step) {
		var __out, __i, __i2, __map, __ns, __a, __l, __ix, __p, __tmp, __chds, __b, __l2, __tn, __id, __dns, __c/*!@*/,$node,$1,$2/*@*/

		$1		= 1
		__out	= []
		__map = {}
		__i		= 0
		__ix	= __step.ix
		__c		= !__step.prefix
		__ns 	= __step.prefix ? __step.ns[__step.prefix] : null
		__id	= __step.tnode && !__step.ttype ? "__lname" : "__type"

		if(__step.tnode === "node")										__tn = null
		else if(__step.ttype)													__tn = __step.tnode
		else if(__step.tnode)													__tn = __step.lname
		else if(__step.ts["default"] != null)					__tn = __step.ts["default"]

		if(__ix < 0)
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				__p 		= __nodes[__a]
				__chds	= __p.__childs || __p.__drv_children()

				if(__chds) {

					__tmp	= []
					__i2	= 0
					__dns	= __p.defaultNs(true)

					for(__b = 0, __l2 = __chds.length; __b < __l2; __b++) {

						$node = __chds[__b]
						$node = $node.__drv ? $node : __p.__drv_child(__b)

						if((__tn ? $node[__id] === __tn : true) && (__c || __ns === ($node.__pfx ? $node.ns() : __dns)) && $2)
							__tmp[__i2++] = $node
					}

					$node = __tmp[__tmp.length + __ix]
					if($node && !__map[$node.__id]) {
						__out[__i++] 			= $node
						__map[$node.__id] = true
					}
				}
			}
		else
			for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

				__p 		= __nodes[__a]
				__chds 	= __p.__childs || __p.__drv_children()

				if(__chds) {

					__dns	= __p.defaultNs(true)

					for(__b = 0, __l2 = __chds.length; __b < __l2; __b++) {

						$node = __chds[__b]
						$node = $node.__drv ? $node : __p.__drv_child(__b)

						if((__tn ? $node[__id] === __tn : true) && (__c || __ns === ($node.__pfx ? $node.ns() : __dns)) && $2)
							if(__ix == null || !--__ix) {
								if(!__map[$node.__id]) {
									__out[__i++] 			= $node
									__map[$node.__id] = true
								}
								if(__ix === 0) break
							}
					}
				}
			}

		return __out
	}
	//-------------------------------------------------------------------------------
	jsl.Node.__qp_findD = function(__nodes, __step) {
		var __out, __i, __i2, __map, __ns, __a, __l, __tmp, __ix, __six, __tn, __id, __p, __cs, __next, __prev, __c, __dns, __b/*!@*/,$node,$1,$2/*@*/

		$1		= 1
		__out	= []
		__map = {}
		__i		= 0
		__b		= !__step.prefix
		__ns 	= __step.prefix ? __step.ns[__step.prefix] : null
		__id	= __step.tnode && !__step.ttype ? "__lname" : "__type"
		__six	= __step.ix

		if(__step.tnode === "node")										__tn = null
		else if(__step.ttype)													__tn = __step.tnode
		else if(__step.tnode)													__tn = __step.lname
		else if(__step.ts["default"] != null)					__tn = __step.ts["default"]

		for(__a = 0, __l = __nodes.length; __a < __l; __a++) {

			$node 	= __nodes[__a]
			__prev	= []
			__tmp		= []
			__i2		= 0
			__c			= true
			$node.childIndex()

			while($node) {

				__p		=  __c ? (__c = false, null) : ($node.__parent === null ? null : $node.parent())
				__cs 	=	$node.__childs || $node.__drv_children()
				__ix	= $node.__cix + 1

				if(__cs.length) {
					$node 			= __cs[0].__drv ? __cs[0] : $node.__drv_child(0)
					$node.__cix = 0
					__next 			= __p && __p.__childs[__ix]

					if(__next) {
						__next 				= __next.__drv ? __next : __p.__drv_child(__ix)
						__next.__cix 	= __ix
						__prev.unshift(__next)
					}
				}
				else {
					$node = __p && __p.__childs[__ix]
					if($node)	$node = $node.__drv ? $node : __p.__drv_child(__ix), $node.__cix = __ix
					else 			$node = __prev.shift()
				}

				if($node)
					if(__six < 0) {
						if((__tn ? $node[__id] === __tn : true) && (__b || $node.ns() === __ns) && $2)
							__tmp[__i2++] = $node
					}
					else
						if((__tn ? $node[__id] === __tn : true) && (__b || $node.ns() === __ns) && $2)
							if(__six == null || !--__six) {
								if(!__map[$node.__id]) {
									__out[__i++] 			= $node
									__map[$node.__id] = true
								}
								if(__six === 0) break
							}
			}

			if(__six < 0) {
				$node = __tmp[__tmp.length + __six]
				if($node && !__map[$node.__id]) {
					__out[__i++]			= $node
					__map[$node.__id] = true
				}
			}
		}
		return __out
	}
